import request from '@/utils/request'

export default {
    //获取课程章节和小节
    getAllChapterVideo(courseId){
        return request({
            // 后端接口
            url: '/eduservice/chapter/getChapterVideo/' + courseId,
            // 请求方式
            method: 'get',
        })
    },
    //根据章节id查询章节信息
    getChapterInfo(chapterId){
        return request({
            url: '/eduservice/chapter/getChapterInfo/' + chapterId,
            method: 'get'
        })
    },
    //添加章节
    addChapter(chapter){
        return request({
            url: '/eduservice/chapter/addChapter',
            method: 'post',
            data: chapter
        })
    },
    //修改章节
    updateChapter(chapter){
        return request({
            url: '/eduservice/chapter/updateChapter',
            method: 'post',
            data: chapter
        })
    },
    //删除章节(如果章节下有小节 2，则不能删除)
    deleteChapter(chapterId){
        return request({
            url: '/eduservice/chapter/deleteChapter/' + chapterId,
            method: 'delete'
        })
    }

}